using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using BO;
using BO.Admin;

namespace Admin
{
    public partial class DeleteNews : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            PerformDelete();
        }

        private void PerformDelete()
        {
            if (Utils.QueryString.GetNewsID() > 0)
            {
                News_Helper.UpdateStatus(Utils.QueryString.GetNewsID(), (int)News.Status.Deleted);
            }
            if (Utils.QueryString.GetReturnUrl().Length > 0) Response.Redirect(Utils.QueryString.GetReturnUrl());
            else Response.Redirect("/ListNews.aspx");
        }
    }
}
